package com.powernode.teatraceability.utils;

import java.util.Base64;

/**
 * ClassName: Base64StrAndBytes
 * Description:
 *
 * @Author: jdz
 * @Create: 2023/5/14 - 16:06
 */
public class Base64StrAndBytes {

    private String base64Str;

    private byte[] bytes;

    public Base64StrAndBytes(){

    }

    public Base64StrAndBytes(String base64Str){
        this.base64Str = base64Str;
        this.bytes = Base64.getDecoder().decode(base64Str);;
    }

    public Base64StrAndBytes(byte[] bytes) {
        this.bytes = bytes;
        this.base64Str = Base64.getEncoder().encodeToString(bytes);
    }

    public byte[] getBase64Bytes(){
        return Base64.getDecoder().decode(base64Str);
    }

    public String getBase64Str(){
        return this.base64Str;
    }

}
